package io.tim.mvc_f2.proxy.test;

import org.springframework.aop.framework.ProxyFactory;

public class test03 {

	public static void main(String[] args) {
		ProxyFactory proxyFactory = new ProxyFactory();
		proxyFactory.setTarget(new HelloImpl());
//		proxyFactory.addAdvice(new GreetingBeforeAdvice());
//		proxyFactory.addAdvice(new GreetingAfterAdvice());
//		proxyFactory.addAdvice(new GreetingBeforeAndAfterAdvice());
		
		proxyFactory.addAdvice(new GreetingAroundAdvice());
		proxyFactory.addAdvice(new GreetingThrowAdvice());
		
		Hello helloProxy = (Hello) proxyFactory.getProxy();
		
		helloProxy.say("String AOP");
		helloProxy.sing("山丘");
	}
}
